# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=totem
pkgver=3.38.1
pkgrel=1
pkgdesc="Movie player for the GNOME desktop based on GStreamer"
url="https://wiki.gnome.org/Apps/Videos"
arch=(x86_64)
license=(GPL2 custom)
depends=(totem-plparser iso-codes libpeas clutter-gtk clutter-gst grilo
         gsettings-desktop-schemas dconf python-gobject python-xdg gnome-desktop
         gst-plugins-base gst-plugins-good gst-plugins-bad)
makedepends=(libnautilus-extension itstool docbook-xsl python-pylint
             gobject-introspection git appstream-glib gtk-doc meson intltool)
optdepends=('gst-plugins-ugly: Extra media codecs'
            'gst-libav: Extra media codecs'
            'grilo-plugins: Media discovery'
            'python-dbus: MPRIS plugin')
groups=(gnome)
conflicts=(totem-plugin)
replaces=(totem-plugin)
_commit=4bd83295abc858322d50ade7b77d228e85b02a96  # tags/V_3_38_1^0
source=("git+https://gitlab.gnome.org/GNOME/totem.git#commit=$_commit"
        "git+https://gitlab.gnome.org/GNOME/libgd.git")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^V_//;s/-fixed//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git submodule set-url subprojects/libgd "$srcdir/libgd"
  git submodule update
}

build() {
  arch-meson $pkgname build -D enable-gtk-doc=true
  meson compile -C build
}

package() {
  meson install -C build --destdir "$pkgdir"
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 $pkgname/COPYING
}
